package com.aifund.app.controller;

import com.aifund.app.service.ExchangeService;
import com.aifund.common.entity.AiExchange;
import com.aifund.common.result.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import okhttp3.internal.connection.Exchange;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "交易所")
@RequestMapping("/api/exchange")
@RestController
public class ExchangeController {

    @Autowired
    ExchangeService exchangeService;

    @GetMapping("/findAll")
    @ApiOperation("获取所有交易所")
    public ResultBody<Exchange> getAll(){
        List<AiExchange> all = exchangeService.findAll();
        return ResultBody.success(all);
    }

}
